﻿using Ags.MonsterTools.Common;
using Ags.Mvvm;
using Microsoft.Practices.Prism.Commands;
using System.Windows;

namespace Ags.MonsterTools
{
    public class MainWindowViewModel : ViewModelBase<MainWindowViewModel>
    {
        private IViewManager _vm;

        public MainWindowViewModel(IViewManager vm)
        {
            _vm = vm;
            CloseCommand = new DelegateCommand(ExecuteCloseCommand);
            ShowAboutCommand = new DelegateCommand(ExecuteShowAboutCommand);
        }

        #region MainMenu Commands

        public DelegateCommand CloseCommand { get; private set; }
        
        void ExecuteCloseCommand()
        {
            Application.Current.MainWindow.Close();
        }

        public DelegateCommand ShowAboutCommand { get; private set; }

        void ExecuteShowAboutCommand()
        {
            _vm.NavigateToView(typeof(AboutWindow), RegionConstants.WINDOWREGION, "About");
        }

        #endregion
    }
}
